import React, { Component } from 'react';

export default class NavMenu extends Component {
    constructor(props) {
        super(props);

    }
    static defaultProps = {
        data: [],
    }
    render() {
        const { data } = this.props;
        const renderMenu = data.map((a, key) => {
            return(
            <div className="menu" key={key}>
                <div onMouseOver={() => this.onTabSelect(a.key)}>
                <a href="#">{a.label}</a>
                </div>
            </div>
            )
        });
        return (
            <div className="nav">
                {renderMenu}
            </div>
        )
    }
    onTabSelect = (key) => {
        this.props.onTabSelect(key);
    }
} 